<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MD_UISwitch Library: MD_UISwitch Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="MajicDesigns_Logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MD_UISwitch Library
   &#160;<span id="projectnumber">2.2</span>
   </div>
   <div id="projectbrief">Library for different types of User Interface switches</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_m_d___u_i_switch.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pro-static-attribs">Static Protected Attributes</a> &#124;
<a href="class_m_d___u_i_switch-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">MD_UISwitch Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;MD_UISwitch.h&gt;</code></p>
<div class="dynheader">
Inheritance diagram for MD_UISwitch:</div>
<div class="dyncontent">
<div class="center"><img src="class_m_d___u_i_switch__inherit__graph.png" border="0" usemap="#a_m_d___u_i_switch_inherit__map" alt="Inheritance graph"/></div>
<map name="a_m_d___u_i_switch_inherit__map" id="a_m_d___u_i_switch_inherit__map">
<area shape="rect" title=" " alt="" coords="6,107,106,133"/>
<area shape="rect" href="class_m_d___u_i_switch__4017_k_m.html" title=" " alt="" coords="155,5,309,32"/>
<area shape="rect" href="class_m_d___u_i_switch___analog.html" title=" " alt="" coords="159,56,305,83"/>
<area shape="rect" href="class_m_d___u_i_switch___digital.html" title=" " alt="" coords="161,107,303,133"/>
<area shape="rect" href="class_m_d___u_i_switch___matrix.html" title=" " alt="" coords="161,157,303,184"/>
<area shape="rect" href="class_m_d___u_i_switch___user.html" title=" " alt="" coords="165,208,299,235"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Enumerated values and Typedefs.</div></td></tr>
<tr class="memitem:a117cd39685e6017f17e942b1d7cbea03"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03">keyResult_t</a> { <br />
&#160;&#160;<a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03ab732e9179752afecef5eb841d7a7ebdf">KEY_NULL</a>
, <a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03a86493b4c254a3b1c571b3d8e92050781">KEY_DOWN</a>
, <a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03a20b5597ee77c9cb6419189f70a62eca2">KEY_UP</a>
, <a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03a15e40279fddacdbb32dd91654747945d">KEY_PRESS</a>
, <br />
&#160;&#160;<a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03ac2243c722c18d06421d166e8fa3a133d">KEY_DPRESS</a>
, <a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03aa96ef0b5c7f6169701f6ae6d5fa7bc20">KEY_LONGPRESS</a>
, <a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03af3457ee4d710d0cc77d760cfc23670b8">KEY_RPTPRESS</a>
<br />
 }</td></tr>
<tr class="separator:a117cd39685e6017f17e942b1d7cbea03"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Class constructor and destructor.</div></td></tr>
<tr class="memitem:a5495560f26e383b94a246ec750427df6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a5495560f26e383b94a246ec750427df6">MD_UISwitch</a> (void)</td></tr>
<tr class="separator:a5495560f26e383b94a246ec750427df6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f64d570dff58f36b097731213f2e50e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a9f64d570dff58f36b097731213f2e50e">~MD_UISwitch</a> ()</td></tr>
<tr class="separator:a9f64d570dff58f36b097731213f2e50e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Methods for core object control.</div></td></tr>
<tr class="memitem:addedb4f16e9fd4e6320f64f724fe5fb9"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#addedb4f16e9fd4e6320f64f724fe5fb9">begin</a> (void)=0</td></tr>
<tr class="separator:addedb4f16e9fd4e6320f64f724fe5fb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace5022164f2c8afb1767ec61798b1bb7"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03">keyResult_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#ace5022164f2c8afb1767ec61798b1bb7">read</a> (void)=0</td></tr>
<tr class="separator:ace5022164f2c8afb1767ec61798b1bb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac77b8bbdb44597e76a3c675c8844f7a"><td class="memItemLeft" align="right" valign="top">virtual uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#aac77b8bbdb44597e76a3c675c8844f7a">getKey</a> (void)</td></tr>
<tr class="separator:aac77b8bbdb44597e76a3c675c8844f7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Methods for object parameters and options.</div></td></tr>
<tr class="memitem:af547a652ad73aff32c8476f5423c56e6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#af547a652ad73aff32c8476f5423c56e6">setPressTime</a> (uint16_t t)</td></tr>
<tr class="separator:af547a652ad73aff32c8476f5423c56e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac29e353ed13dc39671c221201ed1d8c4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#ac29e353ed13dc39671c221201ed1d8c4">setDoublePressTime</a> (uint16_t t)</td></tr>
<tr class="separator:ac29e353ed13dc39671c221201ed1d8c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acddb4bac7da9b76b2ffb64b5fd301c2d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#acddb4bac7da9b76b2ffb64b5fd301c2d">setLongPressTime</a> (uint16_t t)</td></tr>
<tr class="separator:acddb4bac7da9b76b2ffb64b5fd301c2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a758aeea794e3c2ea3b0270e7d71fc04d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a758aeea794e3c2ea3b0270e7d71fc04d">setRepeatTime</a> (uint16_t t)</td></tr>
<tr class="separator:a758aeea794e3c2ea3b0270e7d71fc04d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0581e504add30a9763426c96bc4ffb35"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a0581e504add30a9763426c96bc4ffb35">enableDoublePress</a> (boolean f)</td></tr>
<tr class="separator:a0581e504add30a9763426c96bc4ffb35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf8424f5f69243637ec296530ac57ef1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#aaf8424f5f69243637ec296530ac57ef1">enableLongPress</a> (boolean f)</td></tr>
<tr class="separator:aaf8424f5f69243637ec296530ac57ef1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a62b4c58fe1db440e44e66d54389f588d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a62b4c58fe1db440e44e66d54389f588d">enableRepeat</a> (boolean f)</td></tr>
<tr class="separator:a62b4c58fe1db440e44e66d54389f588d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5190407be944cb37ed0b2e9f06ee925"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#ac5190407be944cb37ed0b2e9f06ee925">enableRepeatResult</a> (boolean f)</td></tr>
<tr class="separator:ac5190407be944cb37ed0b2e9f06ee925"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr class="memitem:a22cd165582deee089c527ed107f4e1fd"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a22cd165582deee089c527ed107f4e1fd">state_fsm</a> { <br />
&#160;&#160;<a class="el" href="class_m_d___u_i_switch.html#a22cd165582deee089c527ed107f4e1fda81457b7aa0e5d24254e54a87887d5f5d">S_IDLE</a>
, <a class="el" href="class_m_d___u_i_switch.html#a22cd165582deee089c527ed107f4e1fdab30cefbee0e52f140753e5baf513d7b0">S_PRESS</a>
, <a class="el" href="class_m_d___u_i_switch.html#a22cd165582deee089c527ed107f4e1fda62920fed53bdf0a4d5641706ef2fc753">S_PRESS2A</a>
, <a class="el" href="class_m_d___u_i_switch.html#a22cd165582deee089c527ed107f4e1fda3d45f26a731b4d3c7130bab296ba90bc">S_PRESS2B</a>
, <br />
&#160;&#160;<a class="el" href="class_m_d___u_i_switch.html#a22cd165582deee089c527ed107f4e1fdab8c115515022025c5c2fbca53f76220c">S_PRESSL</a>
, <a class="el" href="class_m_d___u_i_switch.html#a22cd165582deee089c527ed107f4e1fdae46a21d7cc139db9851249d7c8f4f0a4">S_REPEAT</a>
, <a class="el" href="class_m_d___u_i_switch.html#a22cd165582deee089c527ed107f4e1fda661dfbdc773bfd9f948e47ee17220efa">S_WAIT</a>
<br />
 }</td></tr>
<tr class="separator:a22cd165582deee089c527ed107f4e1fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73c13bc25567360ee3db8a9c2ade225d"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a73c13bc25567360ee3db8a9c2ade225d">state_db</a> { <a class="el" href="class_m_d___u_i_switch.html#a73c13bc25567360ee3db8a9c2ade225da7122d062eafd7efd23393a237ecb5d61">S_WAIT_START</a>
, <a class="el" href="class_m_d___u_i_switch.html#a73c13bc25567360ee3db8a9c2ade225dae6b53613943f0cdd24c1fa6e7f31d08d">S_DEBOUNCE</a>
, <a class="el" href="class_m_d___u_i_switch.html#a73c13bc25567360ee3db8a9c2ade225da674b75dec99aa72f5fc181097746906b">S_WAIT_RELEASE</a>
 }</td></tr>
<tr class="separator:a73c13bc25567360ee3db8a9c2ade225d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a8b13710d6969ed1020bcd32802d9ba06"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03">keyResult_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a8b13710d6969ed1020bcd32802d9ba06">processFSM</a> (bool swState, bool reset=false)</td></tr>
<tr class="separator:a8b13710d6969ed1020bcd32802d9ba06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a3bd9ad717ae33f34e9fa2eefbd1a41"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a5a3bd9ad717ae33f34e9fa2eefbd1a41">debounce</a> (bool curStatus, bool reset=false)</td></tr>
<tr class="separator:a5a3bd9ad717ae33f34e9fa2eefbd1a41"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a89f9192441c42f492a5e7f8bc2affd70"><td class="memItemLeft" align="right" valign="top"><a id="a89f9192441c42f492a5e7f8bc2affd70"></a>
<a class="el" href="class_m_d___u_i_switch.html#a22cd165582deee089c527ed107f4e1fd">state_fsm</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a89f9192441c42f492a5e7f8bc2affd70">_state</a></td></tr>
<tr class="memdesc:a89f9192441c42f492a5e7f8bc2affd70"><td class="mdescLeft">&#160;</td><td class="mdescRight">the FSM current state <br /></td></tr>
<tr class="separator:a89f9192441c42f492a5e7f8bc2affd70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a364f7f0f4d6c69eec354e14ee72a4d87"><td class="memItemLeft" align="right" valign="top"><a id="a364f7f0f4d6c69eec354e14ee72a4d87"></a>
<a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03">keyResult_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a364f7f0f4d6c69eec354e14ee72a4d87">_kPush</a></td></tr>
<tr class="memdesc:a364f7f0f4d6c69eec354e14ee72a4d87"><td class="mdescLeft">&#160;</td><td class="mdescRight">storage for pushed key in FSM <br /></td></tr>
<tr class="separator:a364f7f0f4d6c69eec354e14ee72a4d87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8088c6ba1b4c581e0f04951a1017663"><td class="memItemLeft" align="right" valign="top"><a id="af8088c6ba1b4c581e0f04951a1017663"></a>
uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#af8088c6ba1b4c581e0f04951a1017663">_timeActive</a></td></tr>
<tr class="memdesc:af8088c6ba1b4c581e0f04951a1017663"><td class="mdescLeft">&#160;</td><td class="mdescRight">the millis() time switch was last activated <br /></td></tr>
<tr class="separator:af8088c6ba1b4c581e0f04951a1017663"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa92f25ce35fc3a2f6d458ca5d9b95b56"><td class="memItemLeft" align="right" valign="top"><a id="aa92f25ce35fc3a2f6d458ca5d9b95b56"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#aa92f25ce35fc3a2f6d458ca5d9b95b56">_enableFlags</a></td></tr>
<tr class="memdesc:aa92f25ce35fc3a2f6d458ca5d9b95b56"><td class="mdescLeft">&#160;</td><td class="mdescRight">functions enabled/disabled <br /></td></tr>
<tr class="separator:aa92f25ce35fc3a2f6d458ca5d9b95b56"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af12270236bff624e753fb36761e474f7"><td class="memItemLeft" align="right" valign="top"><a id="af12270236bff624e753fb36761e474f7"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#af12270236bff624e753fb36761e474f7">_RC</a> = 0</td></tr>
<tr class="memdesc:af12270236bff624e753fb36761e474f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">RC integrator value. <br /></td></tr>
<tr class="separator:af12270236bff624e753fb36761e474f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fab36509ef0f309e76e0c30c8438c40"><td class="memItemLeft" align="right" valign="top"><a id="a3fab36509ef0f309e76e0c30c8438c40"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a3fab36509ef0f309e76e0c30c8438c40">_prevStatus</a></td></tr>
<tr class="memdesc:a3fab36509ef0f309e76e0c30c8438c40"><td class="mdescLeft">&#160;</td><td class="mdescRight">previous 'active' status for edge detection <br /></td></tr>
<tr class="separator:a3fab36509ef0f309e76e0c30c8438c40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0635b4d13bc3c4d382dafe305143b786"><td class="memItemLeft" align="right" valign="top"><a id="a0635b4d13bc3c4d382dafe305143b786"></a>
<a class="el" href="class_m_d___u_i_switch.html#a73c13bc25567360ee3db8a9c2ade225d">state_db</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a0635b4d13bc3c4d382dafe305143b786">_RCstate</a></td></tr>
<tr class="memdesc:a0635b4d13bc3c4d382dafe305143b786"><td class="mdescLeft">&#160;</td><td class="mdescRight">current RC debouning state <br /></td></tr>
<tr class="separator:a0635b4d13bc3c4d382dafe305143b786"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a53465ead17577f79bf946ea1be47f654"><td class="memItemLeft" align="right" valign="top"><a id="a53465ead17577f79bf946ea1be47f654"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a53465ead17577f79bf946ea1be47f654">_timePress</a></td></tr>
<tr class="memdesc:a53465ead17577f79bf946ea1be47f654"><td class="mdescLeft">&#160;</td><td class="mdescRight">press time in milliseconds <br /></td></tr>
<tr class="separator:a53465ead17577f79bf946ea1be47f654"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4dc9cf90297ab2a8af69c5a032aa872c"><td class="memItemLeft" align="right" valign="top"><a id="a4dc9cf90297ab2a8af69c5a032aa872c"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a4dc9cf90297ab2a8af69c5a032aa872c">_timeDoublePress</a></td></tr>
<tr class="memdesc:a4dc9cf90297ab2a8af69c5a032aa872c"><td class="mdescLeft">&#160;</td><td class="mdescRight">double press detection time in milliseconds <br /></td></tr>
<tr class="separator:a4dc9cf90297ab2a8af69c5a032aa872c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1458feab310d6192e2b397d0015cfd8f"><td class="memItemLeft" align="right" valign="top"><a id="a1458feab310d6192e2b397d0015cfd8f"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a1458feab310d6192e2b397d0015cfd8f">_timeLongPress</a></td></tr>
<tr class="memdesc:a1458feab310d6192e2b397d0015cfd8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">long press time in milliseconds <br /></td></tr>
<tr class="separator:a1458feab310d6192e2b397d0015cfd8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4513d97e2bee782f75d72252250e1d6b"><td class="memItemLeft" align="right" valign="top"><a id="a4513d97e2bee782f75d72252250e1d6b"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a4513d97e2bee782f75d72252250e1d6b">_timeRepeat</a></td></tr>
<tr class="memdesc:a4513d97e2bee782f75d72252250e1d6b"><td class="mdescLeft">&#160;</td><td class="mdescRight">repeat time delay in milliseconds <br /></td></tr>
<tr class="separator:a4513d97e2bee782f75d72252250e1d6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afbf4adfda419da86355e31e645ce71a1"><td class="memItemLeft" align="right" valign="top"><a id="afbf4adfda419da86355e31e645ce71a1"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#afbf4adfda419da86355e31e645ce71a1">_lastKey</a></td></tr>
<tr class="memdesc:afbf4adfda419da86355e31e645ce71a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">persists the last key value until a new one is detected <br /></td></tr>
<tr class="separator:afbf4adfda419da86355e31e645ce71a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a037dc1bd6b01dbfa4a2101a27913f781"><td class="memItemLeft" align="right" valign="top"><a id="a037dc1bd6b01dbfa4a2101a27913f781"></a>
int16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a037dc1bd6b01dbfa4a2101a27913f781">_lastKeyIdx</a></td></tr>
<tr class="memdesc:a037dc1bd6b01dbfa4a2101a27913f781"><td class="mdescLeft">&#160;</td><td class="mdescRight">internal index of the last key read <br /></td></tr>
<tr class="separator:a037dc1bd6b01dbfa4a2101a27913f781"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-static-attribs"></a>
Static Protected Attributes</h2></td></tr>
<tr class="memitem:a1d9d057da84837fa1c431e5d215b6d63"><td class="memItemLeft" align="right" valign="top"><a id="a1d9d057da84837fa1c431e5d215b6d63"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a1d9d057da84837fa1c431e5d215b6d63">KEY_PRESS_TIME</a> = 150</td></tr>
<tr class="memdesc:a1d9d057da84837fa1c431e5d215b6d63"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default key press time in milliseconds. <br /></td></tr>
<tr class="separator:a1d9d057da84837fa1c431e5d215b6d63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76629bcc4237cfc1566bd5bd65792dbc"><td class="memItemLeft" align="right" valign="top"><a id="a76629bcc4237cfc1566bd5bd65792dbc"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a76629bcc4237cfc1566bd5bd65792dbc">KEY_DPRESS_TIME</a> = 250</td></tr>
<tr class="memdesc:a76629bcc4237cfc1566bd5bd65792dbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default double press time between presses in milliseconds. <br /></td></tr>
<tr class="separator:a76629bcc4237cfc1566bd5bd65792dbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af45f17963823b2149c0b0d3c9ddd7d8a"><td class="memItemLeft" align="right" valign="top"><a id="af45f17963823b2149c0b0d3c9ddd7d8a"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#af45f17963823b2149c0b0d3c9ddd7d8a">KEY_LONGPRESS_TIME</a> = 600</td></tr>
<tr class="memdesc:af45f17963823b2149c0b0d3c9ddd7d8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default long press detection time in milliseconds. <br /></td></tr>
<tr class="separator:af45f17963823b2149c0b0d3c9ddd7d8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a108bf73743831de600ff69f9da508985"><td class="memItemLeft" align="right" valign="top"><a id="a108bf73743831de600ff69f9da508985"></a>
static const uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a108bf73743831de600ff69f9da508985">KEY_REPEAT_TIME</a> = 300</td></tr>
<tr class="memdesc:a108bf73743831de600ff69f9da508985"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default time between repeats in in milliseconds. <br /></td></tr>
<tr class="separator:a108bf73743831de600ff69f9da508985"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf410fb990a4021bf95a4e8bf3489a08"><td class="memItemLeft" align="right" valign="top"><a id="aaf410fb990a4021bf95a4e8bf3489a08"></a>
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#aaf410fb990a4021bf95a4e8bf3489a08">KEY_ACTIVE_STATE</a> = LOW</td></tr>
<tr class="memdesc:aaf410fb990a4021bf95a4e8bf3489a08"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default key is active low - transition high to low detection. <br /></td></tr>
<tr class="separator:aaf410fb990a4021bf95a4e8bf3489a08"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bb598e2f7533b6395ef4b01fc5e83a2"><td class="memItemLeft" align="right" valign="top"><a id="a8bb598e2f7533b6395ef4b01fc5e83a2"></a>
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a8bb598e2f7533b6395ef4b01fc5e83a2">REPEAT_RESULT_ENABLE</a> = 3</td></tr>
<tr class="memdesc:a8bb598e2f7533b6395ef4b01fc5e83a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal status bit to return KS_REPEAT instead of KS_PRESS. <br /></td></tr>
<tr class="separator:a8bb598e2f7533b6395ef4b01fc5e83a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a002290f239982d77adeb397f9466a457"><td class="memItemLeft" align="right" valign="top"><a id="a002290f239982d77adeb397f9466a457"></a>
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#a002290f239982d77adeb397f9466a457">DPRESS_ENABLE</a> = 2</td></tr>
<tr class="memdesc:a002290f239982d77adeb397f9466a457"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal status bit to enable double press. <br /></td></tr>
<tr class="separator:a002290f239982d77adeb397f9466a457"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad053848d2409832412d46042accb76e8"><td class="memItemLeft" align="right" valign="top"><a id="ad053848d2409832412d46042accb76e8"></a>
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#ad053848d2409832412d46042accb76e8">LONGPRESS_ENABLE</a> = 1</td></tr>
<tr class="memdesc:ad053848d2409832412d46042accb76e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal status bit to enable long press. <br /></td></tr>
<tr class="separator:ad053848d2409832412d46042accb76e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeff0768820be6fd3d5b699735f7defff"><td class="memItemLeft" align="right" valign="top"><a id="aeff0768820be6fd3d5b699735f7defff"></a>
static const uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_m_d___u_i_switch.html#aeff0768820be6fd3d5b699735f7defff">REPEAT_ENABLE</a> = 0</td></tr>
<tr class="memdesc:aeff0768820be6fd3d5b699735f7defff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal status bit to enable repeat key. <br /></td></tr>
<tr class="separator:aeff0768820be6fd3d5b699735f7defff"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Core object for the <a class="el" href="class_m_d___u_i_switch.html">MD_UISwitch</a> library </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="a117cd39685e6017f17e942b1d7cbea03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a117cd39685e6017f17e942b1d7cbea03">&#9670;&nbsp;</a></span>keyResult_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03">MD_UISwitch::keyResult_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Return values for switch status</p>
<p>The <a class="el" href="class_m_d___u_i_switch.html#ace5022164f2c8afb1767ec61798b1bb7">read()</a> method returns one of these enumerated values as the result of the switch transition detection. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a117cd39685e6017f17e942b1d7cbea03ab732e9179752afecef5eb841d7a7ebdf"></a>KEY_NULL&#160;</td><td class="fielddoc"><p>No key press. </p>
</td></tr>
<tr><td class="fieldname"><a id="a117cd39685e6017f17e942b1d7cbea03a86493b4c254a3b1c571b3d8e92050781"></a>KEY_DOWN&#160;</td><td class="fielddoc"><p>Switch is detected as active (down) </p>
</td></tr>
<tr><td class="fieldname"><a id="a117cd39685e6017f17e942b1d7cbea03a20b5597ee77c9cb6419189f70a62eca2"></a>KEY_UP&#160;</td><td class="fielddoc"><p>Switch is detected as inactive (up) </p>
</td></tr>
<tr><td class="fieldname"><a id="a117cd39685e6017f17e942b1d7cbea03a15e40279fddacdbb32dd91654747945d"></a>KEY_PRESS&#160;</td><td class="fielddoc"><p>Simple press, or a repeated press sequence if enableRepeatResult(false) (default) </p>
</td></tr>
<tr><td class="fieldname"><a id="a117cd39685e6017f17e942b1d7cbea03ac2243c722c18d06421d166e8fa3a133d"></a>KEY_DPRESS&#160;</td><td class="fielddoc"><p>Double press. </p>
</td></tr>
<tr><td class="fieldname"><a id="a117cd39685e6017f17e942b1d7cbea03aa96ef0b5c7f6169701f6ae6d5fa7bc20"></a>KEY_LONGPRESS&#160;</td><td class="fielddoc"><p>Long press. </p>
</td></tr>
<tr><td class="fieldname"><a id="a117cd39685e6017f17e942b1d7cbea03af3457ee4d710d0cc77d760cfc23670b8"></a>KEY_RPTPRESS&#160;</td><td class="fielddoc"><p>Repeated key press (only if enableRepeatResult(true)) </p>
</td></tr>
</table>

</div>
</div>
<a id="a73c13bc25567360ee3db8a9c2ade225d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a73c13bc25567360ee3db8a9c2ade225d">&#9670;&nbsp;</a></span>state_db</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_m_d___u_i_switch.html#a73c13bc25567360ee3db8a9c2ade225d">MD_UISwitch::state_db</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Debouncing state values</p>
<p>States for the internal Debouncing algorithm </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a73c13bc25567360ee3db8a9c2ade225da7122d062eafd7efd23393a237ecb5d61"></a>S_WAIT_START&#160;</td><td class="fielddoc"><p>Waiting for the debouncing to start. </p>
</td></tr>
<tr><td class="fieldname"><a id="a73c13bc25567360ee3db8a9c2ade225dae6b53613943f0cdd24c1fa6e7f31d08d"></a>S_DEBOUNCE&#160;</td><td class="fielddoc"><p>Currently debouncing state. </p>
</td></tr>
<tr><td class="fieldname"><a id="a73c13bc25567360ee3db8a9c2ade225da674b75dec99aa72f5fc181097746906b"></a>S_WAIT_RELEASE&#160;</td><td class="fielddoc"><p>Waiting for the next transition to be detected. </p>
</td></tr>
</table>

</div>
</div>
<a id="a22cd165582deee089c527ed107f4e1fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22cd165582deee089c527ed107f4e1fd">&#9670;&nbsp;</a></span>state_fsm</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_m_d___u_i_switch.html#a22cd165582deee089c527ed107f4e1fd">MD_UISwitch::state_fsm</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>FSM state values</p>
<p>States for the internal Finite State Machine to recognized the key press </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a22cd165582deee089c527ed107f4e1fda81457b7aa0e5d24254e54a87887d5f5d"></a>S_IDLE&#160;</td><td class="fielddoc"><p>Idle state - waiting for key transition. </p>
</td></tr>
<tr><td class="fieldname"><a id="a22cd165582deee089c527ed107f4e1fdab30cefbee0e52f140753e5baf513d7b0"></a>S_PRESS&#160;</td><td class="fielddoc"><p>Detecting possible simple press. </p>
</td></tr>
<tr><td class="fieldname"><a id="a22cd165582deee089c527ed107f4e1fda62920fed53bdf0a4d5641706ef2fc753"></a>S_PRESS2A&#160;</td><td class="fielddoc"><p>Detecting possible double press part A. </p>
</td></tr>
<tr><td class="fieldname"><a id="a22cd165582deee089c527ed107f4e1fda3d45f26a731b4d3c7130bab296ba90bc"></a>S_PRESS2B&#160;</td><td class="fielddoc"><p>Detecting possible double press part B. </p>
</td></tr>
<tr><td class="fieldname"><a id="a22cd165582deee089c527ed107f4e1fdab8c115515022025c5c2fbca53f76220c"></a>S_PRESSL&#160;</td><td class="fielddoc"><p>Detecting possible long press. </p>
</td></tr>
<tr><td class="fieldname"><a id="a22cd165582deee089c527ed107f4e1fdae46a21d7cc139db9851249d7c8f4f0a4"></a>S_REPEAT&#160;</td><td class="fielddoc"><p>Outputting repeat keys when timer expires. </p>
</td></tr>
<tr><td class="fieldname"><a id="a22cd165582deee089c527ed107f4e1fda661dfbdc773bfd9f948e47ee17220efa"></a>S_WAIT&#160;</td><td class="fielddoc"><p>Waiting for key to be released after long press is detected. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a5495560f26e383b94a246ec750427df6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5495560f26e383b94a246ec750427df6">&#9670;&nbsp;</a></span>MD_UISwitch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">MD_UISwitch::MD_UISwitch </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Class Constructor.</p>
<p>Instantiate a new instance of the class. The main function for the core object is to initialize the internal shared variables and timers to default values. </p>

</div>
</div>
<a id="a9f64d570dff58f36b097731213f2e50e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f64d570dff58f36b097731213f2e50e">&#9670;&nbsp;</a></span>~MD_UISwitch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">MD_UISwitch::~MD_UISwitch </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Class Destructor.</p>
<p>Release any allocated memory and clean up anything else. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="addedb4f16e9fd4e6320f64f724fe5fb9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#addedb4f16e9fd4e6320f64f724fe5fb9">&#9670;&nbsp;</a></span>begin()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void MD_UISwitch::begin </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Initialize the object.</p>
<p>Initialize the object data. This needs to be called during setup() to initialize new data for the class that cannot be done during the object creation. This method must be replaced in the derived class. </p>

<p>Implemented in <a class="el" href="class_m_d___u_i_switch__4017_k_m.html#a7bb2d605aa3e9754d50c1ed41cfb92eb">MD_UISwitch_4017KM</a>, <a class="el" href="class_m_d___u_i_switch___matrix.html#a402364c2205dc809d71db7a04dabc860">MD_UISwitch_Matrix</a>, <a class="el" href="class_m_d___u_i_switch___analog.html#ab2cbb39b93f6e5e3a3271132ea8827fa">MD_UISwitch_Analog</a>, <a class="el" href="class_m_d___u_i_switch___user.html#a4cce9817890289a0a19e4e045d9f08b7">MD_UISwitch_User</a>, and <a class="el" href="class_m_d___u_i_switch___digital.html#a88c56f9e64bc1d254d04d4f137a6edb3">MD_UISwitch_Digital</a>.</p>

</div>
</div>
<a id="a5a3bd9ad717ae33f34e9fa2eefbd1a41"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a3bd9ad717ae33f34e9fa2eefbd1a41">&#9670;&nbsp;</a></span>debounce()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool MD_UISwitch::debounce </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>curStatus</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>reset</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Switch debounce using Edge Detection &amp; Resistor-Capacitor Digital Filter.</p>
<p>A digital filter that mimics an analogue RC filter with first-order recursive low pass filter. It has good EMI filtering and quick response, with a nearly continuous output like an analogue circuit.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">curStatus</td><td>current active status for the switch. </td></tr>
    <tr><td class="paramname">reset</td><td>an optional identifier to reset the debounce detection. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the switch is 'debounced' active, false otherwise. </dd></dl>

</div>
</div>
<a id="a0581e504add30a9763426c96bc4ffb35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0581e504add30a9763426c96bc4ffb35">&#9670;&nbsp;</a></span>enableDoublePress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MD_UISwitch::enableDoublePress </td>
          <td>(</td>
          <td class="paramtype">boolean&#160;</td>
          <td class="paramname"><em>f</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Enable double press detection</p>
<p>Enable or disable double press detection. If disabled, two single press are detected instead of a double press. Default is to detect double press events.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>true to enable, false to disable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aaf8424f5f69243637ec296530ac57ef1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf8424f5f69243637ec296530ac57ef1">&#9670;&nbsp;</a></span>enableLongPress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MD_UISwitch::enableLongPress </td>
          <td>(</td>
          <td class="paramtype">boolean&#160;</td>
          <td class="paramname"><em>f</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Enable long press detection</p>
<p>Enable or disable long press detection. If disabled, the long press notification is skipped when the event is detected and either a simple press or repeats are returned, depending on the setting of the other options. Default is to detect long press events.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>true to enable, false to disable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a62b4c58fe1db440e44e66d54389f588d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a62b4c58fe1db440e44e66d54389f588d">&#9670;&nbsp;</a></span>enableRepeat()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MD_UISwitch::enableRepeat </td>
          <td>(</td>
          <td class="paramtype">boolean&#160;</td>
          <td class="paramname"><em>f</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Enable repeat detection</p>
<p>Enable or disable repeat detection. If disabled, the long press notification is returned as soon as the long press time has expired. Default is to detect repeat events.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>true to enable, false to disable. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ac5190407be944cb37ed0b2e9f06ee925"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5190407be944cb37ed0b2e9f06ee925">&#9670;&nbsp;</a></span>enableRepeatResult()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MD_UISwitch::enableRepeatResult </td>
          <td>(</td>
          <td class="paramtype">boolean&#160;</td>
          <td class="paramname"><em>f</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Modify repeat notification</p>
<p>Modify the result returned from a repeat detection. If enabled, the first repeat will return a KS_PRESS and subsequent repeats will return KS_RPTPRESS. If disabled (default) the repeats will be stream of KS_PRESS values.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>true to enable, false to disable (default). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aac77b8bbdb44597e76a3c675c8844f7a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aac77b8bbdb44597e76a3c675c8844f7a">&#9670;&nbsp;</a></span>getKey()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual uint8_t MD_UISwitch::getKey </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Read the key identifier for the last switch</p>
<p>Return the id for the last active switch. This is useful to know which key was actually pressed when there could be more than one key (ie, a key matrix).</p>
<dl class="section return"><dt>Returns</dt><dd>an identifying index for the key item, depending on implementation </dd></dl>

</div>
</div>
<a id="a8b13710d6969ed1020bcd32802d9ba06"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8b13710d6969ed1020bcd32802d9ba06">&#9670;&nbsp;</a></span>processFSM()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03">MD_UISwitch::keyResult_t</a> MD_UISwitch::processFSM </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>swState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>reset</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Process the key using FSM</p>
<p>Process the key read using a finite state machine to detect the current type of keypress and return one of the keypress types.</p>
<p>The timing for each keypress starts when the first transition of the switch from inactive to active state and is recognized by a finite state machine invoked in process() whose operation is directed by the timer and option values specified.</p>
<p>If the reset parameter is specified the FSM is reset to the idle state and no other processing is performed (ie, the bState parameter is ignored).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">swState</td><td>true if the switch is active, false otherwise. </td></tr>
    <tr><td class="paramname">reset</td><td>an optional identifier to reset the FSM. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>one of the keyResult_t enumerated values. </dd></dl>

</div>
</div>
<a id="ace5022164f2c8afb1767ec61798b1bb7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ace5022164f2c8afb1767ec61798b1bb7">&#9670;&nbsp;</a></span>read()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="class_m_d___u_i_switch.html#a117cd39685e6017f17e942b1d7cbea03">keyResult_t</a> MD_UISwitch::read </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Read input and return the state of the switch</p>
<p>Read the input key switch and invoke the process method to determine what the keystroke means. This method must be replaced in the derived class with a hardware specific method to read the key switch.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_m_d___u_i_switch.html#a8b13710d6969ed1020bcd32802d9ba06">processFSM()</a> method</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>the keyResult_t enumerated value from <a class="el" href="class_m_d___u_i_switch.html#a8b13710d6969ed1020bcd32802d9ba06">processFSM()</a> </dd></dl>

<p>Implemented in <a class="el" href="class_m_d___u_i_switch__4017_k_m.html#a9a7df04604edc8d0763eb6002d604b74">MD_UISwitch_4017KM</a>, <a class="el" href="class_m_d___u_i_switch___matrix.html#adfebd47b7bd20ccad072b00d4346ab2d">MD_UISwitch_Matrix</a>, <a class="el" href="class_m_d___u_i_switch___analog.html#a87c3c39d6a2f88cd631e06bc71a32187">MD_UISwitch_Analog</a>, <a class="el" href="class_m_d___u_i_switch___user.html#a7852ffd5fbd6b07904d298377b2d444b">MD_UISwitch_User</a>, and <a class="el" href="class_m_d___u_i_switch___digital.html#a354575495b5d5a72b478a2ae57d42dd9">MD_UISwitch_Digital</a>.</p>

</div>
</div>
<a id="ac29e353ed13dc39671c221201ed1d8c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac29e353ed13dc39671c221201ed1d8c4">&#9670;&nbsp;</a></span>setDoublePressTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MD_UISwitch::setDoublePressTime </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>t</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the double press detection time</p>
<p>Set the time between each press time in milliseconds. A double press is detected if the switch is released and depressed within this time, measured from when the first press is detected. The default value is set by the KEY_DPRESS_TIME constant.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">t</td><td>the specified time in milliseconds. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="acddb4bac7da9b76b2ffb64b5fd301c2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acddb4bac7da9b76b2ffb64b5fd301c2d">&#9670;&nbsp;</a></span>setLongPressTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MD_UISwitch::setLongPressTime </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>t</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the long press detection time</p>
<p>Set the time in milliseconds after which a continuous press and release is deemed a long press, measured from when the first press is detected. The default value is set by the KEY_LONGPRESS_TIME constant.</p>
<p>Note that the relationship between timer values should be Press Time &lt; Long Press Time &lt; Repeat time. No checking is done in the to enforce this relationship.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">t</td><td>the specified time in milliseconds. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af547a652ad73aff32c8476f5423c56e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af547a652ad73aff32c8476f5423c56e6">&#9670;&nbsp;</a></span>setPressTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MD_UISwitch::setPressTime </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>t</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the press time</p>
<p>Set the switch press time in milliseconds. The default value is set by the KEY_PRESS_TIME constant.</p>
<p>Note that the relationship between timer values should be Press Time &lt; Long Press Time &lt; Repeat time. No checking is done in the to enforce this relationship.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">t</td><td>the specified time in milliseconds. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a758aeea794e3c2ea3b0270e7d71fc04d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a758aeea794e3c2ea3b0270e7d71fc04d">&#9670;&nbsp;</a></span>setRepeatTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MD_UISwitch::setRepeatTime </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>t</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Set the repeat time</p>
<p>Set the time in milliseconds after which a continuous press and hold is treated as a stream of repeated presses, measured from when the first press is detected.</p>
<p>Note that the relationship between timer values should be Press Time &lt; Long Press Time &lt; Repeat time. No checking is done in the to enforce this relationship.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">t</td><td>the specified time in milliseconds. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="_m_d___u_i_switch_8h.html">MD_UISwitch.h</a></li>
<li>src/<a class="el" href="_m_d___u_i_switch_8cpp.html">MD_UISwitch.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_m_d___u_i_switch.html">MD_UISwitch</a></li>
    <li class="footer">Generated on Thu Aug 12 2021 08:19:10 for MD_UISwitch Library by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
